﻿Module GenericAdministrator

    Public Function searchDataById(ByVal stringTable As String, ByVal stringSelect As String, ByVal id As Integer) As Data.DataTable
        Return GenericDao.searchDataById(stringTable, stringSelect, id)
    End Function

    Public Function searchData(ByVal stringTable As String, ByVal stringSelect As String) As Data.DataTable
        Return GenericDao.searchData(stringTable, stringSelect)
    End Function

    Public Sub loadComboBox(ByRef combo As ComboBox, ByRef table As Data.DataTable, ByVal id As String, ByVal description As String)
        combo.Items.Clear()
        combo.DataSource = table
        combo.ValueMember = id
        combo.DisplayMember = description
    End Sub

    Public Sub loadGrid(ByRef grid As DataGridView, ByRef bindingNavigator As BindingNavigator, ByRef table As Data.DataTable)
        Dim bs As New BindingSource
        bs.DataSource = table
        bindingNavigator.BindingSource = bs
        grid.DataSource = bs
    End Sub

    Public Sub loadNavigator(ByRef navigator As BindingNavigator, ByRef source As BindingSource)
        navigator.BindingSource = source
    End Sub

End Module
